﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepStorage.Domain.DTO.Output;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Controllers
{
    /// <summary>
    /// 羊场首页
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class statisticsController : ControllerBase
    {
        private readonly IstatisticsService istatistics;
        public statisticsController(IstatisticsService istatistics)
        {
            this.istatistics = istatistics;
        }
        /// <summary>
        /// 统计待配种
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult CountWaitingbreed()
        {

            return Ok(istatistics.CountWaitingbreed());

        }

        /// <summary>
        /// 羊场实时存栏
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult CountSheepinventory()
        {
            return Ok(istatistics.CountSheepinventory());
        }

        /// <summary>
        /// 羊场30日存栏
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult monthCountSheepinventory()
        {
            return Ok(istatistics.monthCountSheepinventory());
        }
    }
}
